﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PaperInfoEdit.ascx.cs"
    Inherits="ExaminationSys.View.Paper.PaperInfoEdit" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script type="text/javascript" language="javascript">
    var setID = function (param,commnetid) {
        try {

            var hidden = document.getElementById('<%=IDHidden.ClientID %>');
            hidden.value = param;

            var HidPaperFeedBackCommentID = document.getElementById('<%=HidPaperFeedBackCommentID.ClientID %>');
            HidPaperFeedBackCommentID.value = commnetid;
        } catch (e) {
            alert(e);
        }
    };


    //选择评语
    var win;
    function setInfo() {
        var pageurl = "../Paper/PaperFeedBackCommentSelect.aspx";
        win = new Ext.Window({
            title: '选择评语',
            // maximizable : true,
            // maximized : true,
            width: 780,
            height: 520,
            // autoScroll : true,
            // bodyBorder : true,
            // draggable : true,
            isTopContainer: true,
            loadMask: {
                showMask: true,
                msg: "正在加载，请稍后……"
            },
            modal: true,
            resizable: false,
            contentEl: Ext.DomHelper.append(document.body, {
                tag: 'iframe',
                style: "border 0px none;scrollbar:false",
                src: pageurl,
                height: "100%",
                width: "100%"
            })
        });
        win.setPaperInfo = function (id, title) {

            var hidHidPaperFeedBackCommentId = document.getElementById('<%=HidPaperFeedBackCommentID.ClientID %>');
            hidHidPaperFeedBackCommentId.value = id;
            document.getElementById('ctl30_Comment-inputEl').value = title;

        };
        win.show();

    }
 
</script>
<input type="hidden" id="IDHidden" runat="server" />
<input type="hidden" id="HidPaperFeedBackCommentID" runat="server" />
<ext:Window ID="PaperInfoEditWindow" runat="server" Icon="Group" Title="试卷列表-添加试卷"
    Width="680" Height="486" AutoShow="false" Modal="true" Hidden="true" Layout="Fit">
    <Items>
        <ext:FormPanel ID="PaperInfoEditPanel" runat="server" Icon="ChartOrganisation" DefaultAnchor="95%"
            Padding="5" BodyPadding="10">
            <Items>
                <ext:TextField ID="Title" AllowBlank="false" runat="server" FieldLabel="标题" />
                <ext:ComboBox ID="SectionID" AllowBlank="false" runat="server" FieldLabel="栏目" EmptyText="请选择栏目...">
                </ext:ComboBox>
                <ext:ComboBox ID="Level" AllowBlank="false" runat="server" FieldLabel="阶段" EmptyText="请选择阶段..."
                    AnchorHorizontal="45%">
                    <Items>
                        <ext:ListItem Text="高级" Value="1" />
                        <ext:ListItem Text="中级" Value="2" />
                        <ext:ListItem Text="初级" Value="3" />
                    </Items>
                </ext:ComboBox>
                <ext:ComboBox ID="Degree" AllowBlank="false" runat="server" FieldLabel="难度" EmptyText="请选择难度..."
                    AnchorHorizontal="45%">
                    <Items>
                        <ext:ListItem Text="高" Value="1" />
                        <ext:ListItem Text="中" Value="2" />
                        <ext:ListItem Text="低" Value="3" />
                    </Items>
                </ext:ComboBox>
                <ext:ComboBox ID="Type" AllowBlank="false" runat="server"  FieldLabel="类型" EmptyText="请选择类型..."
                    AnchorHorizontal="45%">
                    <Items>
                        <ext:ListItem Text="固定" Value="1"  />
                        <ext:ListItem Text="自动" Value="2" />
                    </Items>
                </ext:ComboBox>
                <ext:NumberField ID="Score" AllowBlank="false" runat="server"   FieldLabel="总分" AnchorHorizontal="45%" />
                <ext:FieldContainer ID="FieldContainer1" runat="server" FieldLabel="评语" Layout="HBoxLayout">
                    <Items>
                        <ext:TextField ID="Comment" AllowBlank="false" runat="server" AnchorHorizontal="45%" />
                        <ext:Button ID="Button1" runat="server" Text="选择评语" Icon="BulletGo" OnClientClick="setInfo()"
                            AnchorHorizontal="12%">
                        </ext:Button>
                    </Items>
                </ext:FieldContainer>
                <ext:NumberField ID="Timeout" AllowBlank="false" runat="server"   FieldLabel="测试时间"
                    AnchorHorizontal="45%" />
                <ext:HtmlEditor ID="Description" AllowBlank="true" FieldLabel="备注" runat="server"
                    AutoScroll="true" Width="120" Height="150" />
            </Items>
        </ext:FormPanel>
    </Items>
    <Buttons>
        <ext:Button ID="SaveButton" runat="server" Text="保存并下一步" Icon="BulletGo">
            <DirectEvents>
                <Click OnEvent="SavePaperInfo" Failure="Ext.MessageBox.alert('Saving failed', 'Error during ajax event');">
                </Click>
            </DirectEvents>
        </ext:Button>
        <ext:Button ID="CancelButton" runat="server" Text="返回" Icon="Cancel">
            <Listeners>
                <Click Handler="#{PaperInfoEditWindow}.hide(null);" />
            </Listeners>
        </ext:Button>
    </Buttons>
</ext:Window>
